<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>作品列表</title>
    <!-- Le styles -->
    <link href="/common/js/bootstrap-3.0.0/css/bootstrap-united.min.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding: 10px 0;
        }
    </style>
</head>
<body>
<div class="container">
    <#--<form id="form" method="post" class="well form-horizontal">
        <fieldset>
            <legend>通知管理</legend>
            <div class="form-group">
                <div class="col-md-4">
                    <label class="col-md-4 control-label" for="username">登录名</label>

                    <div class="col-md-8">
                        <input id="username" name="username" type="text" class="form-control"/>
                    </div>
                </div>

                <div class="col-md-4">
                    <label class="col-md-4 control-label" for="datetime">日期</label>

                    <div class="col-md-8">
                        <input id="datetime" name="datetime" class="form-control Wdate"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
                    </div>
                </div>

                <div class="col-md-4">
                    <label class="col-md-4 control-label" for="logtype">操作行为</label>

                    <div class="col-md-8">
                        <select id="logtype" name="logtype" class="form-control">
                            <option value=""></option>
                            <option value="用户登陆">用户登陆</option>
                            <option value="登陆失败">登陆失败</option>
                            <option value="用户注销">用户注销</option>
                            <option value="新增资源">新增资源</option>
                            <option value="修改资源">修改资源</option>
                            <option value="删除资源">删除资源</option>
                            <option value="添加角色">添加角色</option>
                            <option value="删除角色">删除角色</option>
                            <option value="编辑角色权限">编辑角色权限</option>
                            <option value="添加用户">添加用户</option>
                            <option value="删除用户">删除用户</option>
                            <option value="修改用户">修改用户</option>
                            <option value="修改密码">修改密码</option>
                            <option value="修改规则">修改规则</option>
                            <option value="删除规则">删除规则</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-md-12 text-right">
                    <a style="width: 80px;" href="/msg/addPushMsgView" class="btn btn-success">新建推送</a>
                    <button type="button" id="searchBtn" style="width: 80px;" class="btn btn-primary">查询</button>
                </div>
            </div>
        </fieldset>
    </form>-->

    <div class="col-md-12 text-right" style="margin:10px 0;">
        <button type="button" id="searchBtn" onclick="javascript:history.back(-1);" style="width: 80px;" class="btn btn-success">返回</button>
        <#--<a style="width: 80px;" href="/user/addExampleView" class="btn btn-success">新建</a>-->
    </div>

        <table id="resultTable" class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>编号</th>
                <#--<th>商家</th>-->
                <#--<th>商家手机</th>-->
                <#--<th>商家职业</th>-->
                <th>图片/视频</th>
                <th>描述</th>
                <#--<th>关联子订单</th>-->
                <#--<th>状态</th>-->
                <#--<th>操作</th>-->
            </tr>
            </thead>
            <tbody>
            <script type="text/html">
                <tr>
                    <td>{{id}}</td>
                    <#--<td>{{userInfoBvo.cnName}}</td>-->
                    <#--<td>{{userInfoBvo.mobile}}</td>-->
                    <#--<td>{{userInfoBvo.bizWork.name}}</td>-->
                    <td>{{imgUrl?renderImg}}</td>
                    <td>{{name}}</td>
                    <#--<td>{{order_detail_id!''}}</td>-->
                    <#--<td>{{status?renderStatus}}</td>-->
                    <#--<td>{{_self_data?renderOperation}}</td>-->
                </tr>
            </script>
            </tbody>
        </table>
</div>
<script type="text/javascript" src="/common/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/common/js/bootstrap-table.20130913.js"></script>
<script type="text/javascript" src="/common/js/dateformat.js"></script>
<script type="text/javascript" src="/common/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    $(function () {
        var param = $("#form").serialize();
        var s = $("#resultTable").bsTable({
            url: '/user/getExampleDetailList.json?example_id=${example_id!''}',
            ajaxType: "POST",  //ajax 提交方式 post 或者 get
            pageNo: 1,
            pageNoAlias: 'page',
            pageSize: 10,
            pageSizeAlias: 'pageSize',
            pagingAlign: "right",
            param: param,
            countRoot: "total",
            dataRoot: "list"
        });

        $("#searchBtn").on('click', function () {
            var param = $("#form").serialize();
            s.reload(param);
        });

//        window.onresize = function () {
//            window.top.autoIFrame();
//        }
    });

    function renderImg(imgUrl) {
        if(imgUrl){
            if (imgUrl.indexOf(".mp4") != -1){
                return '<a href="http://img.boyitongcheng.com/'+imgUrl+'" target="_blank"><img src="http://img.boyitongcheng.com/'+imgUrl+'?vframe/jpg/offset/10/w/420/h300" width="80px" height="60px"/></a>';
            }else{
                return '<a href="http://img.boyitongcheng.com/'+imgUrl+'" target="_blank"><img src="http://img.boyitongcheng.com/'+imgUrl+'" width="80px" height="60px"/></a>';
            }
        }
        return "";
    }

    function renderStatus(status) {
        if (status == -1) {
            return "待平台审核";
        } else {
            return "审核通过";
        }
    }

    function renderAuthType(authType) {
        if (authType == 1) {
            return "平台认证";
        } else if(authType == 2) {
            return "诚信认证";
        }else{
            return "学院认证";
        }
    }

    function renderOperation(row) {
        if (row && row.status == -1){
            return '<a style="width: 80px;" href="/user/passExampleView?id={{id}}" class="btn btn-success">审核通过</a>';
        }else{
            return ""
        }

    }

</script>
</body>
</html>